#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include "ConfProto.h"
#include "tblutil.h"
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\PCL.h>

const char*PCLName = "PCL.dat";

static PCL_REC srPCLRec;

static int recordNum;
int	inLoadPCLRec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(PCL_FILENAME, SIZE_PCL_REC, inRecNumber, (char *) &srPCLRec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetPCLRec(void)
{
	return &srPCLRec;

}

int	inSavePCLRec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(PCL_FILENAME, SIZE_PCL_REC, inRecNumber, (char *) &srPCLRec);

	return inRet;
}

int	inGetPCLRecNumber (void)
{
	return recordNum;
}

int	inUpdatePCLRec (void)
{
	int inRet;

	inRet = inSaveConfRec(PCL_FILENAME, SIZE_PCL_REC, recordNum, (char *) &srPCLRec);

	return inRet;
}

void	vdResetPCLRec (void)
{
	memset((void*)&srPCLRec, 0, REC_SIZEOF(srPCLRec));
}

short shGetImamUCLIndex(void)
{
	return srPCLRec.shImamUCLIndex;
}

void vdSetImamUCLIndex(short shImamUCLIndex)
{
	srPCLRec.shImamUCLIndex = shImamUCLIndex;
}

short inGetImamUCLComm(void)
{
	return srPCLRec.inImamUCLComm;
}

void vdSetImamUCLComm(short inImamUCLComm)
{
	srPCLRec.inImamUCLComm = inImamUCLComm;
}

char* szGetImamPriHostIP(void)
{
	return srPCLRec.szImamPriHostIP;
}

void vdSetImamPriHostIP(const char* szImamPriHostIP)
{
	strNumCopy(srPCLRec.szImamPriHostIP, szImamPriHostIP, sizeof(((PCL_REC*)NULL)->szImamPriHostIP)-1);
}

short inGetImamPriPort(void)
{
	return srPCLRec.inImamPriPort;
}

void vdSetImamPriPort(short inImamPriPort)
{
	srPCLRec.inImamPriPort = inImamPriPort;
}

char* szGetImamSecHostIP(void)
{
	return srPCLRec.szImamSecHostIP;
}

void vdSetImamSecHostIP(const char* szImamSecHostIP)
{
	strNumCopy(srPCLRec.szImamSecHostIP, szImamSecHostIP, sizeof(((PCL_REC*)NULL)->szImamSecHostIP)-1);
}

short inGetImamSecPort(void)
{
	return srPCLRec.inImamSecPort;
}

void vdSetImamSecPort(short inImamSecPort)
{
	srPCLRec.inImamSecPort = inImamSecPort;
}

char* szGetImamLocalIP(void)
{
	return srPCLRec.szImamLocalIP;
}

void vdSetImamLocalIP(const char* szImamLocalIP)
{
	strNumCopy(srPCLRec.szImamLocalIP, szImamLocalIP, sizeof(((PCL_REC*)NULL)->szImamLocalIP)-1);
}

char* szGetImamSubnet(void)
{
	return srPCLRec.szImamSubnet;
}

void vdSetImamSubnet(const char* szImamSubnet)
{
	strNumCopy(srPCLRec.szImamSubnet, szImamSubnet, sizeof(((PCL_REC*)NULL)->szImamSubnet)-1);
}

char* szGetImamGateway(void)
{
	return srPCLRec.szImamGateway;
}

void vdSetImamGateway(const char* szImamGateway)
{
	strNumCopy(srPCLRec.szImamGateway, szImamGateway, sizeof(((PCL_REC*)NULL)->szImamGateway)-1);
}

short inGetImamPPPAuth(void)
{
	return srPCLRec.inImamPPPAuth;
}

void vdSetImamPPPAuth(short inImamPPPAuth)
{
	srPCLRec.inImamPPPAuth = inImamPPPAuth;
}

short inGetImamIdleConnectTime(void)
{
	return srPCLRec.inImamIdleConnectTime;
}

void vdSetImamIdleConnectTime(short inImamIdleConnectTime)
{
	srPCLRec.inImamIdleConnectTime = inImamIdleConnectTime;
}

short inGetImamKeepAliveTimer(void)
{
	return srPCLRec.inImamKeepAliveTimer;
}

void vdSetImamKeepAliveTimer(short inImamKeepAliveTimer)
{
	srPCLRec.inImamKeepAliveTimer = inImamKeepAliveTimer;
}

short inGetImamFirstSocketTimeOut(void)
{
	return srPCLRec.inImamFirstSocketTimeOut;
}

void vdSetImamFirstSocketTimeOut(short inImamFirstSocketTimeOut)
{
	srPCLRec.inImamFirstSocketTimeOut = inImamFirstSocketTimeOut;
}

short inGetImamEncryptType(void)
{
	return srPCLRec.inImamEncryptType;
}

void vdSetImamEncryptType(short inImamEncryptType)
{
	srPCLRec.inImamEncryptType = inImamEncryptType;
}

char* szGetImamUCLUserName(void)
{
	return srPCLRec.szImamUCLUserName;
}

void vdSetImamUCLUserName(const char* szImamUCLUserName)
{
	strNumCopy(srPCLRec.szImamUCLUserName, szImamUCLUserName, sizeof(((PCL_REC*)NULL)->szImamUCLUserName)-1);
}

char* szGetImamUCLPassword(void)
{
	return srPCLRec.szImamUCLPassword;
}

void vdSetImamUCLPassword(const char* szImamUCLPassword)
{
	strNumCopy(srPCLRec.szImamUCLPassword, szImamUCLPassword, sizeof(((PCL_REC*)NULL)->szImamUCLPassword)-1);
}

char* szGetImamGPRSDialNo(void)
{
	return srPCLRec.szImamGPRSDialNo;
}

void vdSetImamGPRSDialNo(const char* szImamGPRSDialNo)
{
	strNumCopy(srPCLRec.szImamGPRSDialNo, szImamGPRSDialNo, sizeof(((PCL_REC*)NULL)->szImamGPRSDialNo)-1);
}

char* szGetImamGPRSAPN(void)
{
	return srPCLRec.szImamGPRSAPN;
}

void vdSetImamGPRSAPN(const char* szImamGPRSAPN)
{
	strNumCopy(srPCLRec.szImamGPRSAPN, szImamGPRSAPN, sizeof(((PCL_REC*)NULL)->szImamGPRSAPN)-1);
}

short inGetImamWiFiChannel(void)
{
	return srPCLRec.inImamWiFiChannel;
}

void vdSetImamWiFiChannel(short inImamWiFiChannel)
{
	srPCLRec.inImamWiFiChannel = inImamWiFiChannel;
}

char* szGetImamWiFiSysID(void)
{
	return srPCLRec.szImamWiFiSysID;
}

void vdSetImamWiFiSysID(const char* szImamWiFiSysID)
{
	strNumCopy(srPCLRec.szImamWiFiSysID, szImamWiFiSysID, sizeof(((PCL_REC*)NULL)->szImamWiFiSysID)-1);
}

short inGetImamWiFiWEPMode(void)
{
	return srPCLRec.inImamWiFiWEPMode;
}

void vdSetImamWiFiWEPMode(short inImamWiFiWEPMode)
{
	srPCLRec.inImamWiFiWEPMode = inImamWiFiWEPMode;
}

char* szGetImamWiFiWEPKeyValue(void)
{
	return srPCLRec.szImamWiFiWEPKeyValue;
}

void vdSetImamWiFiWEPKeyValue(const char* szImamWiFiWEPKeyValue)
{
	strNumCopy(srPCLRec.szImamWiFiWEPKeyValue, szImamWiFiWEPKeyValue, sizeof(((PCL_REC*)NULL)->szImamWiFiWEPKeyValue)-1);
}

VS_BOOL fGetImamPCLPADBIT1(void)
{
	return srPCLRec.fImamPCLPADBIT1;
}

void vdSetImamPCLPADBIT1(VS_BOOL fImamPCLPADBIT1)
{
	srPCLRec.fImamPCLPADBIT1 = fImamPCLPADBIT1;
}

VS_BOOL fGetImamPCLPADBIT2(void)
{
	return srPCLRec.fImamPCLPADBIT2;
}

void vdSetImamPCLPADBIT2(VS_BOOL fImamPCLPADBIT2)
{
	srPCLRec.fImamPCLPADBIT2 = fImamPCLPADBIT2;
}

VS_BOOL fGetImamPCLPADBIT3(void)
{
	return srPCLRec.fImamPCLPADBIT3;
}

void vdSetImamPCLPADBIT3(VS_BOOL fImamPCLPADBIT3)
{
	srPCLRec.fImamPCLPADBIT3 = fImamPCLPADBIT3;
}

